import aggdraw
import Image
 
tosaveimage = Image.new("RGB", (500,500), "#FFFFFF")

image = aggdraw.Draw(tosaveimage)

def DrawTriangle(triangle):
    locpen = aggdraw.Pen("black", triangle[3])
    image.line((triangle[0][0], triangle[0][1], triangle[1][0], triangle[1][1]), locpen)
    image.line((triangle[1][0], triangle[1][1], triangle[2][0], triangle[2][1]), locpen)
    image.line((triangle[2][0], triangle[2][1], triangle[0][0], triangle[0][1]), locpen)
    
mtup=((100,100),(200,200),(10,150),2)
DrawTriangle(mtup)

image.flush()

tosaveimage.save("ohshi.bmp", "BMP")